Inserts the a new string at the specified element into an array, returning the adjusted array.
#include <Array.au3>
_ArrayInsert ( $avArray, $iElement[, $sValue] )
Parameters
$avArray | The array from which an element is to be inserted. |
$iElement | The index where the element is to be inserted. |
$sValue | Optional: String to insert at the specified position. |
Return Value
Success: | Returns 1 and updates the original array. |
Failure: | Returns 0. |
@Error: | 0 = No error. |
1 = $avArray isn't an array. |
Remarks
None.
Related
_ArrayAdd, _ArrayDelete
Example
#include <Array.au3>
Dim $avArray[10]
$avArray[0] = "JPM"
$avArray[1] = "Holger"
$avArray[2] = "Jon"
$avArray[3] = "Larry"
$avArray[4] = "Jeremy"
$avArray[5] = "Valik"
$avArray[6] = "Cyberslug"
$avArray[7] = "Nutster"
$avArray[8] = "JdeB"
$avArray[9] = "Tylo"
_ArrayDisplay( $avArray, "Whole array" )
_ArrayInsert( $avArray,4,"New")
_ArrayDisplay( $avArray, "Updated Array" )
Exit